<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>机构管理</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<!-- 当前页面样式 -->
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<!-- 当前页面样式 END -->
<style type="text/css">
.blue{
	color: blue
}
</style>
<script type="text/javascript"
	src="<c:url value="/js/jquery-1.3.2.js" />"></script>
<script type="text/javascript">
$(document).ready(function(){
		$('#sub').click(function(){
			$("#orgQueryForm").attr("action","<%=basePath%>/orgmain/queryOrg.ct");
			$("#orgQueryForm").submit();
			$(this).attr("disabled","true");
		});
		$('#addOrgjsp').click(function(){
			$("#orgQueryForm").attr("action","<%=basePath%>/orgmain/addOrgjsp.ct");
			$("#orgQueryForm").submit();
		});
		$('#updateOrgJsp').click(function(){
			var dd = $("input[name=multi_sel]:checked");
			if(dd.length != 1){
				alert("请选择一条记录");
				return false;
			}
			var id = dd.val();							
			if(dd.length == 0){
				alert("请选择记录");
				return false;
			}else{
				$("#updateOrgJsp").attr("disabled",true);
				$("#orgQueryForm").attr("action","<%=basePath%>/orgmain/updateOrgJsp.ct?orgmain.orgCode="+id);
				$("#orgQueryForm").submit();
			}
		});
		
	});	
</script>
</head>

<body>
		<s:form id="orgQueryForm" action="/orgmain/queryOrg.ct" method="post"
			theme="simple">
		 <table class="tb">
				<tr class="tb-line">
            		<td class="tb-td" colspan="6"><div class="tb-h2">POS收单运营管理平台</div></td>
        		</tr>
			    <tr class="tb-line">
					<td class="tb-td" colspan="6">
						<div class="tb-h3">机构管理</div>
					</td>
				 </tr>



		<tr class="tb-line">
		 <td width="12%" style="min-width: 150px" align="right" class="tb-td">
				 	 <div class="tb-h4" id="blackNum">所属区域：</div>
			</td>
			<td class="tb-td">
                <label class="tb-input-normal">
                	 <s:select cssClass="queryWidth" name="searchCondition.code"
									list="areaCodeList" listKey="id" listValue="name"
									 headerKey="999" headerValue="--请选择--"/>  
				</label> 
			</td>	
			<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                  <div class="tb-h4">机构名称：</div>
            </td>
			<td class="tb-td">
                <label class="tb-input-normal">
                        <s:textfield  name="searchCondition.name" cssClass="queryWidth" /> 
                 </label>
            </td>
           									
		</tr>
				
		<tr>
			<td colspan="7" align="center"><span style="color: red"><s:actionerror /></span>
				<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
						cssClass="fieldError" /></span>
				<span id="otherError"></span>
			</td>
		</tr>
		 <tr class="tb-line">
         		 <td class="tb-td line-submit" align="right" colspan="7">
              <label class="tb-input-submit"><input type="button" value="查询" id="sub"/></label>
		<label class="tb-input-submit"><s:reset value="取 消" /></label> 
		<label class="tb-input-submit"><input type="button" value="修改" id="updateOrgJsp"/></label>
		<label class="tb-input-submit"><input type="button" value="添加" id="addOrgjsp"/></label>
		</td>
		</tr>
		
		<s:if
			test="#request.orgList != null && #request.orgList.size>0">
			<tr class="tb-line">
				<td class="tb-td paging" colspan="7"><page:pageCount
						max_pages="11" totalPage="${requestScope.totalPage}"
						currentPage="${requestScope.currentPage}"
						action="${rootPath}/orgmain/queryOrg.ct?currentPage=" />

				</td>
			</tr>
		</s:if>
	</table>
			
				
	<div class="big-tb">
    <table class="tb" style="width: 100%;">
				<thead>
            	<tr class="tb-line">
                <th class="tb-th" colspan="8"><div class="tb-h3">机构列表</div></th>
            	</tr>
					 <tr class="tb-line bg-gray">
					 <th class="tb-th">选择</th>
					 <th class="tb-th">机构名称</th>	
					 <th class="tb-th">机构编码</th>	
					 <th class="tb-th">所属收单机构</th>	
					 <th class="tb-th">所属区域</th>	
					 <th class="tb-th">创建人</th>	
					 <th class="tb-th">创建时间</th>
					 <th class="tb-th">状态</th>	
					</tr>
				</thead>
				<tbody>
					 <s:iterator value="#request.orgList" status="stat" id="org">
						<tr class="tb-line" >
						<td class="tb-td" align="center">
                   			<input name="multi_sel" value="<s:property value="#org.orgCode"/>" type="checkbox" />
                   			</td>
						   <td class="tb-td"><s:property value="#org.orgName"/></td>
						   <td class="tb-td"><s:property value="#org.orgCode"/></td>
						   <td class="tb-td"><s:property value="#org.superName"/></td>
						   <td class="tb-td"><s:property value="#org.areaName"/></td>
						   <td class="tb-td"><s:property value="#org.oprName"/></td>
						   <td class="tb-td"><s:property value="#org.crtTs"/></td>
						    <td class="tb-td">
						    <s:if test="#org.status==\"1\"">正常  </s:if>
							<s:if test="#org.status==\"2\"">冻结 </s:if>
						</td>
						</tr>
						</s:iterator> 
				</tbody>
			</table>
			</div>
		</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
